<#assign ctx=request.contextPath />
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>审核</title>
    <script src="${ctx}/js/jquery.min.js"></script>
    <link href="${ctx}/layui/css/layui.css" rel="stylesheet">
    <link rel="stylesheet" href="${ctx}/css/ztree/metro/ztree.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/css/treeselect.css" media="all"/>
    <link href="${ctx}/layui/css/modules/layer/default/layer.css" rel="stylesheet">
    <script src="${ctx}/layui/lay/modules/layer.js"></script>
    <style>
        .layui-form-item {
            width: 500px;
        }

        .ztree {
            height: 260px;
            overflow-y: auto;
        }
    </style>
</head>
<body>

<div class="site-text site-block" style=" border:1px solid #ccc; padding:20px; margin:20px;">
    <input hidden id="id" value="${note.id}">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" disabled value="${note.title}" lay-verify="required" class="layui-input"/>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">分类</label>
        <div class="layui-input-block">
            <input type="text" name="lang" disabled value="${note.langStr}" lay-verify="required" class="layui-input"/>
        </div>
    </div>
    <#--<div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <input type="text" name="type" disabled value="${note.typeStr}" lay-verify="required" class="layui-input"/>
        </div>
    </div>-->
    <div class="layui-form-item" id="div_url">
        <label class="layui-form-label">链接</label>
        <div class="layui-input-block">
            <input type="text" name="url" disabled value="${note.url}" lay-verify="required" class="layui-input"/>
            <a class="layui-btn layui-btn-normal" onclick="window.open('${note.url}');">访问</a>
        </div>

    </div>
    <#--<div class="layui-form-item" id="div_project">
        <label class="layui-form-label">相关项目</label>
        <div class="layui-input-block">
            <input type="text" name="project" disabled value="${note.projectStr}" lay-verify="required"
                   class="layui-input"/>
        </div>
    </div>-->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
            <#--<input type="text" name="addCode" lay-verify="required" class="layui-input"/>-->
                <textarea class="layui-textarea" disabled name="ps" style="width: 390px;">${note.ps}</textarea>
            </div>
        </div>
    </div>
    <#--<div class="layui-form-item">-->
        <#--<div class="layui-inline">-->
            <#--<label class="layui-form-label">审核备注</label>-->
            <#--<div class="layui-input-block">-->
            <#--&lt;#&ndash;<input type="text" name="addCode" lay-verify="required" class="layui-input"/>&ndash;&gt;-->
                <#--<textarea class="layui-textarea" id="authPs" style="width: 390px;"></textarea>-->
            <#--</div>-->
        <#--</div>-->
    <#--</div>-->
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" onclick="auth(1);">审核通过</button>
            <button class="layui-btn layui-btn-danger" onclick="auth(2);">审核未通过</button>
            <a href="${ctx}/authList" class="layui-btn layui-btn-primary">返回</a>
        </div>
    </div>
</div>


<script>

    function auth(status) {
        var id = $("#id").val();
        $.ajax({
            url: '${ctx}/auth',
            data: {
                id: id,
                status: status
            },
            success: function (res) {
                if (res.status == 0) {
                    layer.msg(res.msg, {icon: 6, time: 600}, function () {
                        location.href = "${ctx}/authList";
                    })
                } else {
                    layer.msg(res.msg, {icon: 5})
                }
            }
        })
    }

</script>
</body>
</html>
